<?php
session_start();
    if (isset($_SESSION['login'])){
?>
<?php include 'head.php';?>
        <div class="row">
        <div class="row">
          
        </div>
        
      <div class="row">
      <div class="container-fluid main-content">
        <div class="page-title">
          <h1>
            Membro
          </h1>
        </div>
        <!-- DataTables Example -->
        <div class="row">
          <div class="col-lg-12">
            <div class="widget-container fluid-height clearfix">
              <div class="heading">
                  <i class="fa fa-table"></i><a href="cadastra_membro.php">Novo Membro</a>
              </div>
              <div class="widget-content padded clearfix">
                <table class="table table-bordered table-striped" id="dataTable1">
                  <thead>
                    <th class="check-header hidden-xs">
                      <label><input id="checkAll" name="checkAll" type="checkbox"><span></span></label>
                    </th>
                    <th>
                      First Name
                    </th>
                    <th></th>
                  </thead>
                  <tbody>
                        <?php
                            include './conexao.php';
                            include './js/exclui_membro.php';
                          $consulta_membro = mysql_query("select * from membro");
                          $linhas_membro = mysql_num_rows($consulta_membro);
                          
                          for ($cont = 0; $cont < $linhas_membro; $cont++){
                              $membro = mysql_result($consulta_membro, $cont , 'nome_membro');
                              $membroid = mysql_result($consulta_membro, $cont , 'idmembro');
                
                        ?>
                        <tr>
                          <td class="check hidden-xs">
                            <label><input name="optionsRadios1" type="checkbox" value="option1"><span></span></label>
                          </td>
                          <td>
                            <?php echo $membro;?>
                          </td>
                          <td class="actions">
                            <div class="action-buttons">
                                <center>
                                    <a class="table-actions" href="altera_membro.php?id_membro=<?php echo $membroid;?>"><i class="fa fa-pencil"></i></a><a class="table-actions" href="controle/processa_exclui_membro.php?id_membro=<?php echo $membroid;?>" onclick="return exclui_membro();"><i class="fa fa-trash-o"></i></a>
                                </center>
                            </div>
                          </td>
                        </tr>
                          <?php }?>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>
        <!-- end DataTables Example -->
      </div>

      </div>
      </div>
    </div>
    <div class="style-selector">
      <div class="style-selector-container">
        <h2>
          Layout Style
        </h2>
        <select name="layout"><option value="fluid">Fluid</option><option value="boxed">Boxed</option></select>
        <h2>
          Navigation Style
        </h2>
        <select name="nav"><option value="top">Top</option><option value="left">Left</option></select>
        <h2>
          Color Options
        </h2>
        <ul class="color-options clearfix">
          <li>
            <a class="blue" href="javascript:chooseStyle('none', 30)"></a>
          </li>
          <li>
            <a class="green" href="javascript:chooseStyle('green-theme', 30)"></a>
          </li>
          <li>
            <a class="orange" href="javascript:chooseStyle('orange-theme', 30)"></a>
          </li>
          <li>
            <a class="magenta" href="javascript:chooseStyle('magenta-theme', 30)"></a>
          </li>
          <li>
            <a class="gray" href="javascript:chooseStyle('gray-theme', 30)"></a>
          </li>
        </ul>
        <h2>
          Background Patterns
        </h2>
        <ul class="pattern-options clearfix">
          <li>
            <a class="active" href="#" id="bg-1"></a>
          </li>
          <li>
            <a href="#" id="bg-2"></a>
          </li>
          <li>
            <a href="#" id="bg-3"></a>
          </li>
          <li>
            <a href="#" id="bg-4"></a>
          </li>
          <li>
            <a href="#" id="bg-5"></a>
          </li>
        </ul>
        
      </div>
    </div>
  </body>
</html>
<?php
} else {
    echo "<script>alert('Voce nao esta logado')</script>";
    echo"<script>location.href='login2.php'</script>";

//    header('Location: login2.php');
}
?>